package com.example.springbootthread.lifecycle;

/**
 * @author : guorf
 * @version : v1.0
 * @description : TODO 线程的各种状态，测试线程的生命周期
 * @createTime : 2022/7/21 15:07
 */
public class ThreadState {

    public static void main(String[] args) {
        new Thread(new WaitingTime(), "WaitingTimeThread").start();
        new Thread(new WaitingState(), "WaitingStateThread").start();
        // BlockedThread-01线程会抢到锁，BlockedThread-02线程会阻塞
        new Thread(new BlockedThread(), "BlockedThread-01").start();
        new Thread(new BlockedThread(), "BlockedThread-02").start();
    }

    // 命令行通过jps命令查询threadstate的线程id
    // 结合jstack命令与线程id查看个线程状态
}
